home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
AIncludes
/
Dialogs.a
< prev
next >
Wrap
Text File
|
1996-05-01
|
13KB
|
553 lines
;
; File: Dialogs.a
;
; Contains: Dialog Manager interfaces.
;
; Version: Technology: System 7.5
; Release: Universal Interfaces 3.0d3 on Copland DR1
;
; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
;
; Bugs?: If you find a problem with this file, send the file and version
; information (from above) and the problem description to:
;
; Internet: apple.bugs@applelink.apple.com
; AppleLink: APPLE.BUGS
;
;
IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
__DIALOGS__ SET 1
IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
include 'Errors.a'
ENDIF
IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
include 'Memory.a'
ENDIF
IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
include 'Menus.a'
ENDIF
IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
include 'Controls.a'
ENDIF
IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
include 'Windows.a'
ENDIF
IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
include 'TextEdit.a'
ENDIF
IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
include 'Events.a'
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
ctrlItem EQU 4
btnCtrl EQU 0
chkCtrl EQU 1
radCtrl EQU 2
resCtrl EQU 3
statText EQU 8
editText EQU 16
iconItem EQU 32
picItem EQU 64
userItem EQU 0
itemDisable EQU 128
ok EQU 1
cancel EQU 2
stopIcon EQU 0
noteIcon EQU 1
cautionIcon EQU 2
; new, more standard names for dialog item constants
kControlDialogItem EQU 4
kButtonDialogItem EQU 4
kCheckBoxDialogItem EQU 5
kRadioButtonDialogItem EQU 6
kResourceControlDialogItem EQU 7
kStaticTextDialogItem EQU 8
kEditTextDialogItem EQU 16
kIconDialogItem EQU 32
kPictureDialogItem EQU 64
kUserDialogItem EQU 0 ; misc. constants
kItemDisableBit EQU 128
kStdOkItemIndex EQU 1
kStdCancelItemIndex EQU 2 ; standard icon resource id's
kStopIcon EQU 0
kNoteIcon EQU 1
kCautionIcon EQU 2
IF OLDROUTINENAMES THEN
;
; These constants lived briefly on ETO 16. They suggest
; that there is only one index you can use for the OK
; item, which is not true. You can put the ok item
; anywhere you want in the DITL.
;
kOkItemIndex EQU 1
kCancelItemIndex EQU 2
ENDIF
; Dialog Item List Manipulation Constants
; typedef SInt16 DITLMethod
overlayDITL EQU 0
appendDITLRight EQU 1
appendDITLBottom EQU 2
; typedef SInt16 StageList
; typedef DialogPtr DialogRef
DialogRecord RECORD 0
window ds WindowRecord ; offset: $0 (0)
items ds.l 1 ; offset: $9C (156)
textH ds.l 1 ; offset: $A0 (160)
editField ds.w 1 ; offset: $A4 (164)
editOpen ds.w 1 ; offset: $A6 (166)
aDefItem ds.w 1 ; offset: $A8 (168)
sizeof EQU * ; size: $AA (170)
ENDR
; typedef struct DialogRecord * DialogPeek
DialogTemplate RECORD 0
boundsRect ds Rect ; offset: $0 (0)
procID ds.w 1 ; offset: $8 (8)
visible ds.b 1 ; offset: $A (10)
filler1 ds.b 1 ; offset: $B (11)
goAwayFlag ds.b 1 ; offset: $C (12)
filler2 ds.b 1 ; offset: $D (13)
refCon ds.l 1 ; offset: $E (14)
itemsID ds.w 1 ; offset: $12 (18)
title ds Str255 ; offset: $14 (20)
sizeof EQU * ; size: $114 (276)
ENDR
; typedef struct DialogTemplate * DialogTPtr
; typedef DialogTPtr * DialogTHndl
AlertTemplate RECORD 0
boundsRect ds Rect ; offset: $0 (0)
itemsID ds.w 1 ; offset: $8 (8)
stages ds.w 1 ; offset: $A (10)
sizeof EQU * ; size: $C (12)
ENDR
; typedef struct AlertTemplate * AlertTPtr
; typedef AlertTPtr * AlertTHndl
; new type abstractions for the dialog manager
; typedef SInt16 DialogItemIndexZeroBased
; typedef SInt16 DialogItemIndex
; typedef SInt16 DialogItemType
; dialog manager callbacks
;
; NOTE: Code running under MultiFinder or System 7.0 or newer
; should always pass NULL to InitDialogs.
;
;
; pascal void InitDialogs(void *ignored)
;
IF ¨ GENERATINGCFM THEN
_InitDialogs: OPWORD $A97B
ELSE
IMPORT_CFM_FUNCTION InitDialogs
ENDIF
;
; pascal void ErrorSound(SoundUPP soundProc)
;
IF ¨ GENERATINGCFM THEN
_ErrorSound: OPWORD $A98C
ELSE
IMPORT_CFM_FUNCTION ErrorSound
ENDIF
;
; pascal DialogRef NewDialog(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowRef behind, Boolean goAwayFlag, SInt32 refCon, Handle itmLstHndl)
;
IF ¨ GENERATINGCFM THEN
_NewDialog: OPWORD $A97D
ELSE
IMPORT_CFM_FUNCTION NewDialog
ENDIF
;
; pascal DialogRef GetNewDialog(SInt16 dialogID, void *dStorage, WindowRef behind)
;
IF ¨ GENERATINGCFM THEN
_GetNewDialog: OPWORD $A97C
ELSE
IMPORT_CFM_FUNCTION GetNewDialog
ENDIF
;
; pascal DialogRef NewColorDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowRef behind, Boolean goAwayFlag, SInt32 refCon, Handle items)
;
IF ¨ GENERATINGCFM THEN
_NewColorDialog: OPWORD $AA4B
ELSE
IMPORT_CFM_FUNCTION NewColorDialog
ENDIF
;
; pascal void CloseDialog(DialogRef theDialog)
;
IF ¨ GENERATINGCFM THEN
_CloseDialog: OPWORD $A982
ELSE
IMPORT_CFM_FUNCTION CloseDialog
ENDIF
;
; pascal void DisposeDialog(DialogRef theDialog)
;
IF ¨ GENERATINGCFM THEN
_DisposeDialog: OPWORD $A983
ELSE
IMPORT_CFM_FUNCTION DisposeDialog
ENDIF
;
; pascal void ModalDialog(ModalFilterUPP modalFilter, DialogItemIndex *itemHit)
;
IF ¨ GENERATINGCFM THEN
_ModalDialog: OPWORD $A991
ELSE
IMPORT_CFM_FUNCTION ModalDialog
ENDIF
;
; pascal Boolean IsDialogEvent(const EventRecord *theEvent)
;
IF ¨ GENERATINGCFM THEN
_IsDialogEvent: OPWORD $A97F
ELSE
IMPORT_CFM_FUNCTION IsDialogEvent
ENDIF
;
; pascal Boolean DialogSelect(const EventRecord *theEvent, DialogRef *theDialog, DialogItemIndex *itemHit)
;
IF ¨ GENERATINGCFM THEN
_DialogSelect: OPWORD $A980
ELSE
IMPORT_CFM_FUNCTION DialogSelect
ENDIF
;
; pascal void DrawDialog(DialogRef theDialog)
;
IF ¨ GENERATINGCFM THEN
_DrawDialog: OPWORD $A981
ELSE
IMPORT_CFM_FUNCTION DrawDialog
ENDIF
;
; pascal void UpdateDialog(DialogRef theDialog, RgnHandle updateRgn)
;
IF ¨ GENERATINGCFM THEN
_UpdateDialog: OPWORD $A978
ELSE
IMPORT_CFM_FUNCTION UpdateDialog
ENDIF
;
; pascal void HideDialogItem(DialogRef theDialog, DialogItemIndex itemNo)
;
IF ¨ GENERATINGCFM THEN
_HideDialogItem: OPWORD $A827
ELSE
IMPORT_CFM_FUNCTION HideDialogItem
ENDIF
;
; pascal void ShowDialogItem(DialogRef theDialog, DialogItemIndex itemNo)
;
IF ¨ GENERATINGCFM THEN
_ShowDialogItem: OPWORD $A828
ELSE
IMPORT_CFM_FUNCTION ShowDialogItem
ENDIF
;
; pascal DialogItemIndexZeroBased FindDialogItem(DialogRef theDialog, Point thePt)
;
IF ¨ GENERATINGCFM THEN
_FindDialogItem: OPWORD $A984
ELSE
IMPORT_CFM_FUNCTION FindDialogItem
ENDIF
;
; pascal DialogItemIndex Alert(SInt16 alertID, ModalFilterUPP modalFilter)
;
IF ¨ GENERATINGCFM THEN
_Alert: OPWORD $A985
ELSE
IMPORT_CFM_FUNCTION Alert
ENDIF
;
; pascal DialogItemIndex StopAlert(SInt16 alertID, ModalFilterUPP modalFilter)
;
IF ¨ GENERATINGCFM THEN
_StopAlert: OPWORD $A986
ELSE
IMPORT_CFM_FUNCTION StopAlert
ENDIF
;
; pascal DialogItemIndex NoteAlert(SInt16 alertID, ModalFilterUPP modalFilter)
;
IF ¨ GENERATINGCFM THEN
_NoteAlert: OPWORD $A987
ELSE
IMPORT_CFM_FUNCTION NoteAlert
ENDIF
;
; pascal DialogItemIndex CautionAlert(SInt16 alertID, ModalFilterUPP modalFilter)
;
IF ¨ GENERATINGCFM THEN
_CautionAlert: OPWORD $A988
ELSE
IMPORT_CFM_FUNCTION CautionAlert
ENDIF
;
; pascal void GetDialogItem(DialogRef theDialog, DialogItemIndex itemNo, DialogItemType *itemType, Handle *item, Rect *box)
;
IF ¨ GENERATINGCFM THEN
_GetDialogItem: OPWORD $A98D
ELSE
IMPORT_CFM_FUNCTION GetDialogItem
ENDIF
;
; pascal void SetDialogItem(DialogRef theDialog, DialogItemIndex itemNo, DialogItemType itemType, Handle item, const Rect *box)
;
IF ¨ GENERATINGCFM THEN
_SetDialogItem: OPWORD $A98E
ELSE
IMPORT_CFM_FUNCTION SetDialogItem
ENDIF
;
; pascal void ParamText(ConstStr255Param param0, ConstStr255Param param1, ConstStr255Param param2, ConstStr255Param param3)
;
IF ¨ GENERATINGCFM THEN
_ParamText: OPWORD $A98B
ELSE
IMPORT_CFM_FUNCTION ParamText
ENDIF
;
; pascal void SelectDialogItemText(DialogRef theDialog, DialogItemIndex itemNo, SInt16 strtSel, SInt16 endSel)
;
IF ¨ GENERATINGCFM THEN
_SelectDialogItemText: OPWORD $A97E
ELSE
IMPORT_CFM_FUNCTION SelectDialogItemText
ENDIF
;
; pascal void GetDialogItemText(Handle item, Str255 text)
;
IF ¨ GENERATINGCFM THEN
_GetDialogItemText: OPWORD $A990
ELSE
IMPORT_CFM_FUNCTION GetDialogItemText
ENDIF
;
; pascal void SetDialogItemText(Handle item, ConstStr255Param text)
;
IF ¨ GENERATINGCFM THEN
_SetDialogItemText: OPWORD $A98F
ELSE
IMPORT_CFM_FUNCTION SetDialogItemText
ENDIF
;
; pascal SInt16 GetAlertStage(void)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetAlertStage &dest=(sp)
move.w $0A9A,&dest
EndM
ELSE
IMPORT_CFM_FUNCTION GetAlertStage
ENDIF
;
; pascal void SetDialogFont(SInt16 value)
;
IF ¨ GENERATINGCFM THEN
Macro
_SetDialogFont &src=(sp)+
move.w &src,$0AFA
EndM
ELSE
IMPORT_CFM_FUNCTION SetDialogFont
ENDIF
;
; pascal void ResetAlertStage(void )
;
IF ¨ GENERATINGCFM THEN
Macro
_ResetAlertStage
clr.w $0A9A
EndM
ELSE
IMPORT_CFM_FUNCTION ResetAlertStage
ENDIF
;
; pascal void AppendDITL(DialogRef theDialog, Handle theHandle, DITLMethod method)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION AppendDITL
ENDIF
;
; pascal DialogItemIndex CountDITL(DialogRef theDialog)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION CountDITL
ENDIF
;
; pascal void ShortenDITL(DialogRef theDialog, DialogItemIndex numberItems)
;
IF GENERATINGCFM THEN
IMPORT_CFM_FUNCTION ShortenDITL
ENDIF
;
; pascal OSErr GetStdFilterProc(ModalFilterUPP *theProc)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetStdFilterProc
move.w #$0203,D0
dc.w $AA68
EndM
ELSE
IMPORT_CFM_FUNCTION GetStdFilterProc
ENDIF
;
; pascal OSErr SetDialogDefaultItem(DialogRef theDialog, DialogItemIndex newItem)
;
IF ¨ GENERATINGCFM THEN
Macro
_SetDialogDefaultItem
move.w #$0304,D0
dc.w $AA68
EndM
ELSE
IMPORT_CFM_FUNCTION SetDialogDefaultItem
ENDIF
;
; pascal OSErr SetDialogCancelItem(DialogRef theDialog, DialogItemIndex newItem)
;
IF ¨ GENERATINGCFM THEN
Macro
_SetDialogCancelItem
move.w #$0305,D0
dc.w $AA68
EndM
ELSE
IMPORT_CFM_FUNCTION SetDialogCancelItem
ENDIF
;
; pascal OSErr SetDialogTracksCursor(DialogRef theDialog, Boolean tracks)
;
IF ¨ GENERATINGCFM THEN
Macro
_SetDialogTracksCursor
move.w #$0306,D0
dc.w $AA68
EndM
ELSE
IMPORT_CFM_FUNCTION SetDialogTracksCursor
ENDIF
IF OLDROUTINENAMES THEN
ENDIF
;
;*****************************************************************************
;* *
;* The conditional STRICT_DIALOGS has been removed from this interface file. *
;* The accessor macros to a DialogRecord are no longer necessary. *
;* *
;*****************************************************************************
;
;Details:
;The original purpose of the STRICT_ conditionals and accessor macros was to
;help ease the transition to Copland. Shared data structures are difficult
;to coordinate in a preemptive multitasking OS. By hiding the fields in a
;WindowRecord and other data structures, we would begin the migration to
;system data structures being completely hidden from applications.
;
;After many design reviews, it was finally concluded that with this sort of
;migration, the system could never tell when an application was no longer
;peeking at a WindowRecord, and thus the data structure might never become
;system owned. Additionally, there were many other limitations in the classic
;toolbox that were begging to be addressed.
;
;The final decision was to leave the traditional toolbox as a compatibility mode.
;The preferred toolbox API for Copland is a new SOM(tm) based architecture
;(e.g. HIWindows.idl). Windows, menu, controls, etc are each a SOM object
;with methods for drawing, event handling, and customization.
;
;
ENDIF
IF FOR_SYSTEM7_ONLY THEN
;
; pascal void CouldDialog(SInt16 dialogID)
;
IF ¨ GENERATINGCFM THEN
_CouldDialog: OPWORD $A979
ELSE
IMPORT_CFM_FUNCTION CouldDialog
ENDIF
;
; pascal void FreeDialog(SInt16 dialogID)
;
IF ¨ GENERATINGCFM THEN
_FreeDialog: OPWORD $A97A
ELSE
IMPORT_CFM_FUNCTION FreeDialog
ENDIF
;
; pascal void CouldAlert(SInt16 alertID)
;
IF ¨ GENERATINGCFM THEN
_CouldAlert: OPWORD $A989
ELSE
IMPORT_CFM_FUNCTION CouldAlert
ENDIF
;
; pascal void FreeAlert(SInt16 alertID)
;
IF ¨ GENERATINGCFM THEN
_FreeAlert: OPWORD $A98A
ELSE
IMPORT_CFM_FUNCTION FreeAlert
ENDIF
ENDIF
ENDIF ; __DIALOGS__